package cn.etg.day09;

import java.util.Date;

/**
 * 创建一个线程，每秒输出一次当前系统时间:yyyy-MM-dd HH:mm:ss
 * @author Xiloer
 *
 */
public class Test04 {
    public static void main(String[] args) {
        Thread th1 = new Thread(){
            public void run(){
                while (true){
                    try {
                        Thread.sleep(1000);
                    Date date = new Date();
                    System.out.println(date);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        };
        th1.start();
    }
}
